<template>
   <h1>主页</h1>
   <router-link to="/about/1">蜗牛学院</router-link><br>
   <button @click="go">阿多比设计学院</button>
</template>

<script>
import {onMounted} from 'vue'
import {useRouter,useRoute} from 'vue-router'
export default {
    setup(){
        const router=useRouter()
        const route=useRoute()
        const go=()=>{
              router.replace({
                path:'/about/2'
              })
        }
        onMounted(()=>{
            console.log(route.query.id);
        })
        return{
            go
        }
    }
}
</script>

<style>

</style>